# Contributor: Daniel Sabogal <dsabogalcc@gmail.com>
# Maintainer:
pkgname=global
pkgver=6.6.3
pkgrel=0
pkgdesc="A source code tag system"
options="!check" # No testsuite
url="https://www.gnu.org/software/global"
arch="all"
license="GPL-3.0-or-later AND LGPL-3.0-or-later"
makedepends="libltdl perl"
subpackages="$pkgname-doc"
source="https://ftp.gnu.org/gnu/global/$pkgname-$pkgver.tar.gz"

build() {
	./configure \
		--prefix=/usr \
		--localstatedir=/var \
		--with-exuberant-ctags=/usr/bin/ctags \
		--disable-gtagscscope \
		--disable-static
	make
}

package() {
	make DESTDIR="$pkgdir/" install

	install -d "$pkgdir"/usr/share/emacs/site-lisp
	install -d "$pkgdir"/usr/share/vim/vimfiles/plugin
	mv "$pkgdir"/usr/share/gtags/gtags.el "$pkgdir"/usr/share/emacs/site-lisp/gtags.el
	mv "$pkgdir"/usr/share/gtags/gtags.vim "$pkgdir"/usr/share/vim/vimfiles/plugin/gtags.vim
	mv "$pkgdir"/usr/share/gtags/gtags-cscope.vim "$pkgdir"/usr/share/vim/vimfiles/plugin/gtags-cscope.vim
}

sha512sums="1edeb571e9105fb9c2a217bbfbcc3f273be1d7f078921c2ce1a9acb60ed1330268df6a68248a9676476338e74c4a77fb37bff68a6bf37f958ba99502b5c5755d  global-6.6.3.tar.gz"
